const app = getApp();
Page({
  data: {
    atten:''

  },

  onLoad: function (options) {

  },

  onShow: function () {
    this.getService();
  },

  getService(){
    let that = this;
    app.util.request({
      url: 'common/wechatworker/geCsInfo',
      cachetime: 0,
      success: function (res) {
        console.log('res',res)
        res.data.data && res.data.data.status && that.setData({
          plugid: res.data.data.plugid,
          plugidList:res.data.data.plugid_multi,
          atten:res.data.data.atten
        });
      },
      fail: function (err) {
        console.log(err);
      },
    });
  },
  completemessage: function (e) {
    // -3006，当前已是好友，提示退出小程序进行对话。个人不再受到[服务通知]推送
    if (e.detail.errcode === -3006) {
      return wx.showModal({
        title: '提示',
        content: '您已添加该客服为您的微信好友，您可以在微信聊天界面-[服务通知]中添加客服企业微信进行对话',
      });
    }
    if (e.detail.errcode === -3005) {
      return wx.showToast({
        title: '客服消息发送失败',
        duration: 1500,
        icon: 'none',
      });
    }
    if (e.detail.errcode === -3008) {
      return wx.showToast({
        title: '当前配置没有客服人员',
        duration: 1500,
        icon: 'none',
      });
    }
    if (e.detail.errcode === 0) {
      wx.showToast({
        title: '消息已发送成功，请查看邀请通知',
        duration: 1500,
        icon: 'none',
      });
    }
  },

  onReachBottom: function () {

  },

  onShareAppMessage: function () {

  }
})